package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by chengang on 2017/6/8.
 */

public class PerformanceApi extends BaseApi{

    PerformanceReq req;
    public PerformanceApi(String link_mobile,String sale_type,String days) {
        req = new PerformanceReq(link_mobile,sale_type,days);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).hzOrder(requestBody);
    }

    class PerformanceReq {
        public String link_mobile;
        public String sale_type;
        public String days;

        public PerformanceReq(String link_mobile,String sale_type,String days){
            this.link_mobile = link_mobile;
            this.sale_type = sale_type;
            this.days = days;
        }
    }
}
